#include <iostream>
using namespace std;
class Point{
public:
    Point(int x=0, int y=0):x(x),y(y){}
    int getX() const{return x;}
    int getY() const{return y;}
private:
    int x,y;
};
int main() {
    Point a(4,5);
    Point *pa=&a;
    cout<<a.getX()<<endl; 
    cout<<pa->getX()<<endl; 
    
    int (Point::*p)() const;
	p= &Point::getX;
	cout<<(a.*p)()<<endl; 
	cout<<(pa->*p)()<<endl; 
	return 0;
}







